Skip to content

feat: implement circuit breaker with closed/open/half-open states #60

Merged
merged 2 commits into from
Apr 8, 2026

Conversation

francinv
Copy link
Member

@francinv francinv commented Apr 6, 2026

Closes #51

  • Add CircuitBreaker class in new network package with three states: CLOSED (requests pass), OPEN (requests blocked), HALF_OPEN (one probe)
  • Trips after 3 consecutive heartbeat failures, 10s cooldown before probe
  • Integrate into GameNetworkHandler: gates saveMove and sendHeartbeat
  • Connection UI reflects breaker state (Disconnected/Reconnecting/latency)

- Add CircuitBreaker class in new network package with three states:
  CLOSED (requests pass), OPEN (requests blocked), HALF_OPEN (one probe)
- Trips after 3 consecutive heartbeat failures, 10s cooldown before probe
- Integrate into GameNetworkHandler: gates saveMove and sendHeartbeat
- Connection UI reflects breaker state (Disconnected/Reconnecting/latency)
@francinv francinv requested review from benjamls and jonasew April 6, 2026 20:56
@francinv francinv self-assigned this Apr 6, 2026
@jonasew jonasew merged commit b21877f into development Apr 8, 2026
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants